package com.wzz.seckillone.activeMq.base;

import com.wzz.seckillone.utils.SnowFlake;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Component;


import javax.jms.Queue;
import java.util.UUID;

/**
 * @ProjectName: seckillOne
 * @Package: com.wzz.seckillone.activeMq
 * @ClassName: QueueMessageProducer
 * @Author: wzz
 * @Description:
 * @Date: 2022/3/20 15:52
 * @Version: 1.0
 */
@Component
public class QueueMessageProducer {
    @Autowired
    private JmsMessagingTemplate jmsMessagingTemplate;

    @Autowired
    private Queue queue;//别导错包


    public void produceMsg(){
        jmsMessagingTemplate.convertAndSend(queue,"***:"+UUID.randomUUID().toString().substring(0,6));
    }

}
